<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 判断两个事件是否存在冲突 -->
    <script>
      var haveConflict = function (event1, event2) {
        if (event1[0] < event2[0]) {
          // e1比e2早开始，如果冲突，e1要在e2开始以后结束
          return event1[1] >= event2[0]
        } else {
          // e2比e1早开始，如果冲突，e2要在e1开始后结束
          return event2[1] >= event1[0]
        }
      }
      // console.log(haveConflict(['01:15', '02:00'], (event2 = ['02:00', '03:00'])))
      // console.log(haveConflict(['01:00', '02:00'], (event2 = ['01:20', '03:00'])))
      console.log(haveConflict(['10:00', '11:00'], (event2 = ['14:00', '15:00'])))
    </script>
  </body>
</html>
